#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static char ctermid_name[L_ctermid];

char * ctermid(char *str)
{
    if(str == NULL)
    {
        str = ctermid_name;
    }
    return (strcpy(str,"/dev/tty"));
}

int main(void)
{
    printf("%s\n",  ctermid(NULL));
    exit(0);
}
